package com.yueyang.sojourn.server.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author andy.yang
 * @summary 订单类型枚举
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-17
 */
@AllArgsConstructor
public enum OrderTypeEnum implements IEnum {

    MERCH(1, "普通商品"),
    VIP(2, "会员")
    ;

    @Getter
    private int code;

    @Getter
    private String desc;

    public static OrderTypeEnum getByCode(int code){
        for(OrderTypeEnum typeEnum :OrderTypeEnum.values()){
            if (typeEnum.getCode() == code){
                return typeEnum;
            }
        }
        return null;
    }
}
